package net.adetech.crj.entity;

import java.io.Serializable;

public class Hall implements Serializable {
    private int id;
    private String hallName;
    private double longitude;
    private double latitude;
    private String tel;
    private String address;
    private String serviceTypeA1;
    private String serviceTypeA2;
    private String serviceTypeA3;
    private String serviceTypeA4;
    private String serviceTypeB1;
    private String serviceTypeB2;
    private String serviceTypeB3;
    private String serviceTypeC1;
    private String serviceTypeC2;
    private String serviceTypeC3;
    private String serviceTypeC4;
    private String serviceTypeC5;
    private String serviceTypeC6;
    private String workingTime;

    private int queueCountA;
    private int queueCountB;
    private int queueCountC;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getHallName() {
        return hallName;
    }

    public void setHallName(String hallName) {
        this.hallName = hallName;
    }

    public double getLongitude() {
        return longitude;
    }

    public void setLongitude(double longitude) {
        this.longitude = longitude;
    }

    public double getLatitude() {
        return latitude;
    }

    public void setLatitude(double latitude) {
        this.latitude = latitude;
    }

    public String getTel() {
        return tel;
    }

    public void setTel(String tel) {
        this.tel = tel;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getServiceTypeA1() {
        return serviceTypeA1;
    }

    public void setServiceTypeA1(String serviceTypeA1) {
        this.serviceTypeA1 = serviceTypeA1;
    }

    public String getServiceTypeA2() {
        return serviceTypeA2;
    }

    public void setServiceTypeA2(String serviceTypeA2) {
        this.serviceTypeA2 = serviceTypeA2;
    }

    public String getServiceTypeA3() {
        return serviceTypeA3;
    }

    public void setServiceTypeA3(String serviceTypeA3) {
        this.serviceTypeA3 = serviceTypeA3;
    }

    public String getServiceTypeA4() {
        return serviceTypeA4;
    }

    public void setServiceTypeA4(String serviceTypeA4) {
        this.serviceTypeA4 = serviceTypeA4;
    }

    public String getServiceTypeB1() {
        return serviceTypeB1;
    }

    public void setServiceTypeB1(String serviceTypeB1) {
        this.serviceTypeB1 = serviceTypeB1;
    }

    public String getServiceTypeB2() {
        return serviceTypeB2;
    }

    public void setServiceTypeB2(String serviceTypeB2) {
        this.serviceTypeB2 = serviceTypeB2;
    }

    public String getServiceTypeB3() {
        return serviceTypeB3;
    }

    public void setServiceTypeB3(String serviceTypeB3) {
        this.serviceTypeB3 = serviceTypeB3;
    }

    public String getServiceTypeC1() {
        return serviceTypeC1;
    }

    public void setServiceTypeC1(String serviceTypeC1) {
        this.serviceTypeC1 = serviceTypeC1;
    }

    public String getServiceTypeC2() {
        return serviceTypeC2;
    }

    public void setServiceTypeC2(String serviceTypeC2) {
        this.serviceTypeC2 = serviceTypeC2;
    }

    public String getServiceTypeC3() {
        return serviceTypeC3;
    }

    public void setServiceTypeC3(String serviceTypeC3) {
        this.serviceTypeC3 = serviceTypeC3;
    }

    public String getServiceTypeC4() {
        return serviceTypeC4;
    }

    public void setServiceTypeC4(String serviceTypeC4) {
        this.serviceTypeC4 = serviceTypeC4;
    }

    public String getServiceTypeC5() {
        return serviceTypeC5;
    }

    public void setServiceTypeC5(String serviceTypeC5) {
        this.serviceTypeC5 = serviceTypeC5;
    }

    public String getServiceTypeC6() {
        return serviceTypeC6;
    }

    public void setServiceTypeC6(String serviceTypeC6) {
        this.serviceTypeC6 = serviceTypeC6;
    }

    public int getQueueCountA() {
        return queueCountA;
    }

    public void setQueueCountA(int queueCountA) {
        this.queueCountA = queueCountA;
    }

    public int getQueueCountB() {
        return queueCountB;
    }

    public void setQueueCountB(int queueCountB) {
        this.queueCountB = queueCountB;
    }

    public int getQueueCountC() {
        return queueCountC;
    }

    public void setQueueCountC(int queueCountC) {
        this.queueCountC = queueCountC;
    }

    private double distance;

    public double getDistance() {
        return distance;
    }

    public void setDistance(double distance) {
        this.distance = distance;
    }

    public String getDistanceName() {
        if (this.distance <= 1) {
            return (int) (this.distance * 1000) + "m";
        } else {
            return ((int) (this.distance * 10)) / 10d + "km";
        }
    }

    public String getServiceName() {
        String serviceName = "";
        if ("1".equals(this.serviceTypeA1) ||
                "1".equals(this.serviceTypeA2) ||
                "1".equals(this.serviceTypeA3) ||
                "1".equals(this.serviceTypeA4)) {
            serviceName = "公民业务";
        }
        if ("1".equals(this.serviceTypeB1) ||
                "1".equals(this.serviceTypeB2) ||
                "1".equals(this.serviceTypeB3)) {
            if(!"".equals(serviceName))
            {
                serviceName += "、";

            }
            serviceName += "境外业务";

        }
        if ("1".equals(this.serviceTypeC1) ||
                "1".equals(this.serviceTypeC2) ||
                "1".equals(this.serviceTypeC3) ||
                "1".equals(this.serviceTypeC4) ||
                "1".equals(this.serviceTypeC5) ||
                "1".equals(this.serviceTypeC6)) {
            if(!"".equals(serviceName))
            {
                serviceName += "、";

            }
            serviceName += "综合业务";

        }
        return serviceName;
    }
    public boolean getServiceFlagA()
    {
        return "1".equals(this.serviceTypeA1) ||
                "1".equals(this.serviceTypeA2) ||
                "1".equals(this.serviceTypeA3) ||
                "1".equals(this.serviceTypeA4);
    }

    public boolean getServiceFlagB()
    {
        return "1".equals(this.serviceTypeB1) ||
                "1".equals(this.serviceTypeB2) ||
                "1".equals(this.serviceTypeB3);
    }

    public boolean getServiceFlagC()
    {
        return "1".equals(this.serviceTypeC1) ||
                "1".equals(this.serviceTypeC2) ||
                "1".equals(this.serviceTypeC3) ||
                "1".equals(this.serviceTypeC4) ||
                "1".equals(this.serviceTypeC5) ||
                "1".equals(this.serviceTypeC6);
    }
    public String getDistanceColor()
    {
        if (this.getDistance()<=3)
        {
            return "#24C238";
        }
        else if(this.getDistance()<10)
        {
            return "#FFB429";
        }
        else {
            return "#FF564E";
        }
    }

    public String getWorkingTime() {

        return workingTime;
    }

    public void setWorkingTime(String workingTime) {
        this.workingTime = workingTime;
    }

    public String[] getWorkingTimeList(){
        if(workingTime!=null)
        {
            return  workingTime.split("\n");
        }
        else {
            return new String[0];
        }
    }
}
